﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace city7
{
    public partial class FormReportFromGRID : Form
    {
        public bool IsOk;

        public FormReportFromGRID()
        {
            InitializeComponent(); IsOk = false;
        }
        public FormReportFromGRID(DataTable dto) : this()
        {
            dataGridView1.DataSource = dto; set();
        }
       

        void set()
        {
            dataGridView1.Rows[0].Height = 40;
            dataGridView1.Rows[0].DefaultCellStyle.BackColor = Color.White;
            int ic = dataGridView1.RowCount;
            
            for (int j = 1; j < ic; j++)
            { 
                dataGridView1.Rows[j].Height = 25;
                
            }

            int ih = dataGridView1.ColumnCount;

            for (int h = 0; h < ih; h++)
            {
                if(h==0)
                dataGridView1.Columns[h].Width = 30;
                else if (h == 1) { dataGridView1.Columns[h].Width = 150; }
                else if (h == 2) { dataGridView1.Columns[h].Width = 70; }
                else if (h == 3) { dataGridView1.Columns[h].Width = 70; }
                else if (h == 5) { dataGridView1.Columns[h].Width = 150; }
                else dataGridView1.Columns[h].Width = 100;
            }
        }

        private void toolStripDropDownButton4_Click(object sender, EventArgs e)
        {
            IsOk = false;
        }

        private void toolStripDropDownButton2_Click(object sender, EventArgs e)
        {
            IsOk = true;
        }
       
    }
}
